package com.downbox.repository;

import com.downbox.domain.Contribution;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 投稿记录仓库接口
 */
@Repository
public interface ContributionRepository extends JpaRepository<Contribution, Long> {
    /**
     * 根据用户ID统计投稿总数
     */
    long countByUid(Long uid);

    /**
     * 查询所有待处理的投稿
     */
    List<Contribution> findByStatusAndCreatedAtBefore(Contribution.ContributionStatus status, LocalDateTime dateTime);
}